home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / exec / alert.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-12  |  1.9 KB  |  87 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: alert.c,v 1.5 1996/08/16 14:04:40 digulla Exp $
  4.     $Log: alert.c,v $
  5.     Revision 1.5  1996/08/16 14:04:40  digulla
  6.     Show more infos about the task
  7.  
  8.     Revision 1.4  1996/08/13 13:55:57  digulla
  9.     Replaced __AROS_LA by __AROS_LHA
  10.     Replaced some __AROS_LH*I by __AROS_LH*
  11.     Sorted and added includes
  12.  
  13.     Revision 1.3  1996/08/01 17:41:04  digulla
  14.     Added standard header for all files
  15.  
  16.     Desc:
  17.     Lang:
  18. */
  19. #include <exec/execbase.h>
  20. #include <aros/libcall.h>
  21. #include <stdio.h>
  22. #include <stdlib.h>
  23.  
  24. /*****************************************************************************
  25.  
  26.     NAME */
  27.     #include <exec/alerts.h>
  28.     #include <clib/exec_protos.h>
  29.  
  30.     __AROS_LH1(void, Alert,
  31.  
  32. /*  SYNOPSIS */
  33.     __AROS_LHA(unsigned long, alertNum, D7),
  34.  
  35. /*  LOCATION */
  36.     struct ExecBase *, SysBase, 18, Exec)
  37.  
  38. /*  FUNCTION
  39.     Alerts the user of a serious system problem.
  40.  
  41.     INPUTS
  42.     alertNum - This is a number which contains information about
  43.         the reason for the call.
  44.  
  45.     RESULT
  46.     This routine may return, if the alert is not a dead-end one.
  47.  
  48.     NOTES
  49.     You should not call this routine because it halts the machine,
  50.     displays the message and then may reboot it.
  51.  
  52.     EXAMPLE
  53.     // Dead-End alert: 680x0 Access To Odd Address
  54.     Alert (0x80000003);
  55.  
  56.     BUGS
  57.  
  58.     SEE ALSO
  59.  
  60.     INTERNALS
  61.  
  62.     HISTORY
  63.     26-08-95    digulla created after EXEC-Routine
  64.  
  65. ******************************************************************************/
  66. {
  67.     __AROS_FUNC_INIT
  68.     struct Task * task;
  69.  
  70.     task = FindTask (NULL);
  71.  
  72.     /* since this is an emulation, we just show the bug in the console */
  73.     fprintf (stderr
  74.     , "GURU Meditation %04lx %04lx %s\nTask: %p (%s)\n"
  75.     , alertNum >> 16
  76.     , alertNum & 0xFFFF
  77.     , (alertNum & 0x80000000) ? "(DEADEND)" : ""
  78.     , task, task->tc_Node.ln_Name
  79.     );
  80.  
  81.     if (alertNum & AT_DeadEnd)
  82.     exit (20);
  83.  
  84.     __AROS_FUNC_EXIT
  85. } /* Alert */
  86.  
  87.